package b面向对象.day4.demo1_强制转换;

public class Test {
    public static void main1(String[] args) {
        double d=5;
        Animal a=new Dog();//向上转型或向上造型
        Dog dog=(Dog)a;
    }

    public static void main(String[] args) {
        Object o=new Dog();
        //o=new Object();
//        Animal a=(Animal) o;
        if(o instanceof Object){
            System.out.println("true");
        }else {
            System.out.println("false");
        }
    }
}
